import request from '@/utils/request';

/**
 * 普通账号密码登录方式 普通账号密码登录方式
 * GET /user/login
 */
export async function normalLogin(data: API.LoginParams, options?: API.baseOption) {
  return request<API.LoginInfo>('/login', {
    method: 'POST',
    data,
    ...(options || {}),
  });
}

/**
 *  权限查询
 */
export async function getAuthorization(options?: API.baseOption) {
  return request<API.AuthorizationItem[]>('/getAuthorization', {
    method: 'POST',
    ...(options || {}),
  });
}

/**
 * crm 登录
 */
export async function crmLogin(data: API.CrmLoginParam, options?: API.baseOption) {
  return request<API.LoginInfo>('/crm/login', {
    method: 'POST',
    data,
    ...(options || {}),
  });
}
